<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Initialization Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__ctdac__functions__init.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Initialization Functions<div class="ingroups"><a class="el" href="group__group__ctdac.html">CTDAC        (Continuous Time Digital to Analog Converter)</a> &raquo; <a class="el" href="group__group__ctdac__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>This set of functions are for initializing, enabling, and disabling the CTDAC. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga09e11de95212716c56148f93ba65df41"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__ctdac__enums.html#ga7b2ca56166b65cd317310f9d42aa8714">cy_en_ctdac_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__init.html#ga09e11de95212716c56148f93ba65df41">Cy_CTDAC_Init</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base, const <a class="el" href="structcy__stc__ctdac__config__t.html">cy_stc_ctdac_config_t</a> *config)</td></tr>
<tr class="memdesc:ga09e11de95212716c56148f93ba65df41"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize all CTDAC configuration registers.  <a href="#ga09e11de95212716c56148f93ba65df41">More...</a><br /></td></tr>
<tr class="separator:ga09e11de95212716c56148f93ba65df41"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf6019bb1774c3c364880c4f72a23857a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__ctdac__enums.html#ga7b2ca56166b65cd317310f9d42aa8714">cy_en_ctdac_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__init.html#gaf6019bb1774c3c364880c4f72a23857a">Cy_CTDAC_DeInit</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base, bool deInitRouting)</td></tr>
<tr class="memdesc:gaf6019bb1774c3c364880c4f72a23857a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset CTDAC registers back to power on reset defaults.  <a href="#gaf6019bb1774c3c364880c4f72a23857a">More...</a><br /></td></tr>
<tr class="separator:gaf6019bb1774c3c364880c4f72a23857a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga66f44760b2a923f78135b20060c5700d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__ctdac__enums.html#ga7b2ca56166b65cd317310f9d42aa8714">cy_en_ctdac_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__init.html#ga66f44760b2a923f78135b20060c5700d">Cy_CTDAC_FastInit</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base, const <a class="el" href="structcy__stc__ctdac__fast__config__t.html">cy_stc_ctdac_fast_config_t</a> *config)</td></tr>
<tr class="memdesc:ga66f44760b2a923f78135b20060c5700d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the CTDAC to one of the common use modes.  <a href="#ga66f44760b2a923f78135b20060c5700d">More...</a><br /></td></tr>
<tr class="separator:ga66f44760b2a923f78135b20060c5700d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf11183d5debb690a8240f2ee4d304d44"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__init.html#gaf11183d5debb690a8240f2ee4d304d44">Cy_CTDAC_Enable</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base)</td></tr>
<tr class="memdesc:gaf11183d5debb690a8240f2ee4d304d44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Power up the CTDAC hardware block.  <a href="#gaf11183d5debb690a8240f2ee4d304d44">More...</a><br /></td></tr>
<tr class="separator:gaf11183d5debb690a8240f2ee4d304d44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5240b925d07516384e1e30cd3501161e"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__init.html#ga5240b925d07516384e1e30cd3501161e">Cy_CTDAC_Disable</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base)</td></tr>
<tr class="memdesc:ga5240b925d07516384e1e30cd3501161e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Turn off the hardware block.  <a href="#ga5240b925d07516384e1e30cd3501161e">More...</a><br /></td></tr>
<tr class="separator:ga5240b925d07516384e1e30cd3501161e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga09e11de95212716c56148f93ba65df41"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga09e11de95212716c56148f93ba65df41">&#9670;&nbsp;</a></span>Cy_CTDAC_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__ctdac__enums.html#ga7b2ca56166b65cd317310f9d42aa8714">cy_en_ctdac_status_t</a> Cy_CTDAC_Init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__ctdac__config__t.html">cy_stc_ctdac_config_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize all CTDAC configuration registers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">config</td><td>Pointer to structure containing configuration data</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status of initialization, <a class="el" href="group__group__ctdac__enums.html#gga7b2ca56166b65cd317310f9d42aa8714a879677d631f02819c86007343cccaabe">CY_CTDAC_SUCCESS</a> or <a class="el" href="group__group__ctdac__enums.html#gga7b2ca56166b65cd317310f9d42aa8714aebc46fca797dd4930fed83d4f994da93">CY_CTDAC_BAD_PARAM</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* Scenario: Configure the CTDAC to use VDDA as the reference source with an unbuffered output.</span></div><div class="line"><span class="comment">     * A 500 kHz peripheral clock is enabled and connected to the CTDAC for buffered writes. */</span></div><div class="line">    </div><div class="line">    <a class="code" href="group__group__ctdac__enums.html#ga7b2ca56166b65cd317310f9d42aa8714">cy_en_ctdac_status_t</a> status;</div><div class="line">    </div><div class="line">    <span class="keyword">const</span> <a class="code" href="structcy__stc__ctdac__config__t.html">cy_stc_ctdac_config_t</a> config =</div><div class="line">    {</div><div class="line">        <span class="comment">/* .refSource       = */</span> <a class="code" href="group__group__ctdac__enums.html#gga9c4416c55b96c81979223ec469eb7e0ead259b9dd0e37537ea74be700fbe554f4">CY_CTDAC_REFSOURCE_VDDA</a>,           <span class="comment">/* Use VDDA as reference. */</span></div><div class="line">        <span class="comment">/* .formatMode      = */</span> <a class="code" href="group__group__ctdac__enums.html#gga52a4e5920c369f3cc51b3618668f02e0ad7396b32a7ac35fe30197b985a323c38">CY_CTDAC_FORMAT_SIGNED</a>,            <span class="comment">/* Set the register format to signed. */</span></div><div class="line">        <span class="comment">/* .updateMode      = */</span> <a class="code" href="group__group__ctdac__enums.html#gga9c7cd756a8fb870da1b75887a7d0e667a2c1155ae02faa08119b024bbdc95e051">CY_CTDAC_UPDATE_BUFFERED_WRITE</a>,    <span class="comment">/* Set the update mode to buffered write. */</span></div><div class="line">        <span class="comment">/* .deglitchMode    = */</span> <a class="code" href="group__group__ctdac__enums.html#ggaa5bbaaf21bda846a109573f84f1e2735afc4a6c4c15e30a8c37456639ed6994d6">CY_CTDAC_DEGLITCHMODE_UNBUFFERED</a>,  <span class="comment">/* Enable deglitching on the unbuffered output path. */</span></div><div class="line">        <span class="comment">/* .outputMode      = */</span> <a class="code" href="group__group__ctdac__enums.html#gga151d4aa27fabb95182a2494782994ccbaa0eedb42bfda13365d835dcc21ef33e6">CY_CTDAC_OUTPUT_VALUE</a>,             <span class="comment">/* Enable the output to drive the register value. */</span></div><div class="line">        <span class="comment">/* .outputBuffer    = */</span> <a class="code" href="group__group__ctdac__enums.html#ggaa51b6ab267228b6cd7db22b8e1174b17a734375184e4565a397a7c725d2029b4e">CY_CTDAC_OUTPUT_UNBUFFERED</a>,        <span class="comment">/* Output is unbuffered to pin. */</span></div><div class="line">        <span class="comment">/* .deepSleep       = */</span> <a class="code" href="group__group__ctdac__enums.html#gga08fecfbfc0d670966ae1aabe0db5ff2aae31913053d33b3e08828568d5c3ac335">CY_CTDAC_DEEPSLEEP_ENABLE</a>,         <span class="comment">/* Enable the CTDAC to operate in Deep Sleep mode. */</span></div><div class="line">        <span class="comment">/* .deglitchCycles  = */</span> 34uL,                              <span class="comment">/* Set the deglitch time to 700 ns. */</span></div><div class="line">                                                                    <span class="comment">/* Deglitch time = (DEGLITCH_CNT + 1) / PERI_CLOCK_FREQ */</span></div><div class="line">        <span class="comment">/* .value           = */</span> 0uL,                               <span class="comment">/* With signed format, set the initial output voltage to Vdda/2. */</span></div><div class="line">        <span class="comment">/* .nextValue       = */</span> 0uL,</div><div class="line">        <span class="comment">/* .enableInterrupt = */</span> <span class="keyword">true</span>,                              <span class="comment">/* Enable interrupt. */</span></div><div class="line">        <span class="comment">/* .configClock     = */</span> <span class="keyword">true</span>,                              <span class="comment">/* Configure and connect the CTDAC clock. */</span></div><div class="line">        <span class="comment">/* .dividerType     = */</span> <a class="code" href="group__group__sysclk__clk__peripheral__enums.html#gga06138349be16d91fd5d00ded2f4592b8ad2299deae6e36a070de5a60368b319ad">CY_SYSCLK_DIV_8_BIT</a>,               <span class="comment">/* Use the 8-bit clock dividers for the CTDAC clock source. */</span></div><div class="line">        <span class="comment">/* .dividerNum      = */</span> 0uL,                               <span class="comment">/* Select divider number 0. */</span></div><div class="line">        <span class="comment">/* .dividerIntValue = */</span> 99uL,                              <span class="comment">/* Set the CTDAC clock frequency to 500 kHz based on a 50 MHz PeriClk. */</span></div><div class="line">                                                                    <span class="comment">/* CTDAC clock frequency = PERI_CLOCK_FREQ / (dividerIntValue + 1) */</span></div><div class="line">        <span class="comment">/* .dividerFracValue= */</span> <a class="code" href="group__group__ctdac__macros.html#ga09d9d40a41829617dca08666b014eeeb">CY_CTDAC_DEINIT</a>,</div><div class="line">    };</div><div class="line"></div><div class="line">    status = <a class="code" href="group__group__ctdac__functions__init.html#ga09e11de95212716c56148f93ba65df41">Cy_CTDAC_Init</a>(CTDAC0, &amp;config);</div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__ctdac__enums.html#gga7b2ca56166b65cd317310f9d42aa8714a879677d631f02819c86007343cccaabe">CY_CTDAC_SUCCESS</a> == status)</div><div class="line">    {</div><div class="line">        <span class="comment">/* Turn on the hardware block. */</span></div><div class="line">        <a class="code" href="group__group__ctdac__functions__init.html#gaf11183d5debb690a8240f2ee4d304d44">Cy_CTDAC_Enable</a>(CTDAC0);</div><div class="line">    }</div></div><!-- fragment -->
</div>
</div>
<a id="gaf6019bb1774c3c364880c4f72a23857a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf6019bb1774c3c364880c4f72a23857a">&#9670;&nbsp;</a></span>Cy_CTDAC_DeInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__ctdac__enums.html#ga7b2ca56166b65cd317310f9d42aa8714">cy_en_ctdac_status_t</a> Cy_CTDAC_DeInit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>deInitRouting</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reset CTDAC registers back to power on reset defaults. </p>
<dl class="section note"><dt>Note</dt><dd>Does not disable the clock.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">deInitRouting</td><td>If true, all switches are reset to their default state. If false, switch registers are untouched.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status of initialization, <a class="el" href="group__group__ctdac__enums.html#gga7b2ca56166b65cd317310f9d42aa8714a879677d631f02819c86007343cccaabe">CY_CTDAC_SUCCESS</a>, or <a class="el" href="group__group__ctdac__enums.html#gga7b2ca56166b65cd317310f9d42aa8714aebc46fca797dd4930fed83d4f994da93">CY_CTDAC_BAD_PARAM</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: The CTDAC is no longer used or needs to be disabled. */</span></div><div class="line">    </div><div class="line">    <span class="comment">/* Disable and reset the CTDAC including switches. */</span></div><div class="line">    (void) <a class="code" href="group__group__ctdac__functions__init.html#gaf6019bb1774c3c364880c4f72a23857a">Cy_CTDAC_DeInit</a>(CTDAC0, <span class="keyword">true</span>);</div></div><!-- fragment -->
</div>
</div>
<a id="ga66f44760b2a923f78135b20060c5700d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga66f44760b2a923f78135b20060c5700d">&#9670;&nbsp;</a></span>Cy_CTDAC_FastInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__ctdac__enums.html#ga7b2ca56166b65cd317310f9d42aa8714">cy_en_ctdac_status_t</a> Cy_CTDAC_FastInit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__ctdac__fast__config__t.html">cy_stc_ctdac_fast_config_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the CTDAC to one of the common use modes. </p>
<p>This function provides a quick and easy method of configuring the CTDAC when using the PDL driver for device configuration.</p>
<p>The other configuration options are set to:</p><ul>
<li>.formatMode = <a class="el" href="group__group__ctdac__enums.html#gga52a4e5920c369f3cc51b3618668f02e0a857df09f0afd7fba059d4acdc9602238">CY_CTDAC_FORMAT_UNSIGNED</a></li>
<li>.updateMode = <a class="el" href="group__group__ctdac__enums.html#gga9c7cd756a8fb870da1b75887a7d0e667a2c1155ae02faa08119b024bbdc95e051">CY_CTDAC_UPDATE_BUFFERED_WRITE</a></li>
<li>.deglitchMode = <a class="el" href="group__group__ctdac__enums.html#ggaa5bbaaf21bda846a109573f84f1e2735ac297e08904e92c27a89c93376be1c4af">CY_CTDAC_DEGLITCHMODE_NONE</a></li>
<li>.outputMode = <a class="el" href="group__group__ctdac__enums.html#gga151d4aa27fabb95182a2494782994ccbaa0eedb42bfda13365d835dcc21ef33e6">CY_CTDAC_OUTPUT_VALUE</a></li>
<li>.deepSleep = <a class="el" href="group__group__ctdac__enums.html#gga08fecfbfc0d670966ae1aabe0db5ff2aaa778385d0a67e4301eadfac057f8e917">CY_CTDAC_DEEPSLEEP_DISABLE</a></li>
<li>.deglitchCycles = <a class="el" href="group__group__ctdac__macros.html#ga09d9d40a41829617dca08666b014eeeb">CY_CTDAC_DEINIT</a></li>
<li>.value = <a class="el" href="group__group__ctdac__macros.html#ga5a9f25fde21535d97d5f3a17d047e979">CY_CTDAC_UNSIGNED_MID_CODE_VALUE</a></li>
<li>.nextValue = <a class="el" href="group__group__ctdac__macros.html#ga5a9f25fde21535d97d5f3a17d047e979">CY_CTDAC_UNSIGNED_MID_CODE_VALUE</a></li>
<li>.enableInterrupt = true</li>
<li>.configClock = true</li>
<li>.dividerType = <a class="el" href="group__group__ctdac__macros.html#ga4ab2fd44ae77e71deabb82a246710c67">CY_CTDAC_FAST_CLKCFG_TYPE</a></li>
<li>.dividerNum = <a class="el" href="group__group__ctdac__macros.html#ga70b5ed4f58c33ac0114fb5f064ec3130">CY_CTDAC_FAST_CLKCFG_NUM</a></li>
<li>.dividerInitValue = <a class="el" href="group__group__ctdac__macros.html#ga6400fbc0421123965bab006807b70a88">CY_CTDAC_FAST_CLKCFG_DIV</a></li>
<li>.dividerFracValue = <a class="el" href="group__group__ctdac__macros.html#ga09d9d40a41829617dca08666b014eeeb">CY_CTDAC_DEINIT</a></li>
</ul>
<p>A separate call to <a class="el" href="group__group__ctdac__functions__init.html#gaf11183d5debb690a8240f2ee4d304d44">Cy_CTDAC_Enable</a> is needed to turn on the hardware.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">config</td><td>Pointer to structure containing configuration data for quick initialization. Define your own or use one of the provided structures:<ul>
<li><a class="el" href="group__group__ctdac__globals.html#ga049a58c183e635b93a450976bf49660a">Cy_CTDAC_Fast_VddaRef_UnbufferedOut</a></li>
<li><a class="el" href="group__group__ctdac__globals.html#gaaac60a859d3b9f0235dbdbfe4346ef22">Cy_CTDAC_Fast_VddaRef_BufferedOut</a></li>
<li><a class="el" href="group__group__ctdac__globals.html#ga27c002738be38f380472ea16d1155051">Cy_CTDAC_Fast_OA1Ref_UnbufferedOut</a></li>
<li><a class="el" href="group__group__ctdac__globals.html#ga28e709a157ae32116c0eca332ef6fc65">Cy_CTDAC_Fast_OA1Ref_BufferedOut</a></li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status of initialization, <a class="el" href="group__group__ctdac__enums.html#gga7b2ca56166b65cd317310f9d42aa8714a879677d631f02819c86007343cccaabe">CY_CTDAC_SUCCESS</a> or <a class="el" href="group__group__ctdac__enums.html#gga7b2ca56166b65cd317310f9d42aa8714aebc46fca797dd4930fed83d4f994da93">CY_CTDAC_BAD_PARAM</a></dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<p>The following code snippets configures VDDA as the reference source and routes the output directly to Pin 6 (unbuffered).</p>
<div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* Scenario: Quickly configure the CTDAC using one of the common use cases</span></div><div class="line"><span class="comment">     * provided by the driver. The Cy_CTDAC_Fast_VddaRef_UnbufferedOut configuration</span></div><div class="line"><span class="comment">     * will use VDDA as the reference source and route the output directly to P9.6. */</span></div><div class="line">    <a class="code" href="group__group__ctdac__enums.html#ga7b2ca56166b65cd317310f9d42aa8714">cy_en_ctdac_status_t</a> status;</div><div class="line">    </div><div class="line">    status = <a class="code" href="group__group__ctdac__functions__init.html#ga66f44760b2a923f78135b20060c5700d">Cy_CTDAC_FastInit</a>(CTDAC0, &amp;<a class="code" href="group__group__ctdac__globals.html#ga049a58c183e635b93a450976bf49660a">Cy_CTDAC_Fast_VddaRef_UnbufferedOut</a>);</div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__ctdac__enums.html#gga7b2ca56166b65cd317310f9d42aa8714a879677d631f02819c86007343cccaabe">CY_CTDAC_SUCCESS</a> == status)</div><div class="line">    {</div><div class="line">        <span class="comment">/* Turn on the hardware block. */</span></div><div class="line">        <a class="code" href="group__group__ctdac__functions__init.html#gaf11183d5debb690a8240f2ee4d304d44">Cy_CTDAC_Enable</a>(CTDAC0);</div><div class="line">    }</div></div><!-- fragment --> <dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<p>The following code snippet shows how the CTDAC and CTB blocks can quickly be configured to work together. The code configures the CTDAC to use a buffered output, a buffered reference source from the internal bandgap voltage, and closes all required analog routing switches.</p>
<div class="image">
<img src="ctdac_fast_init_funcusage.png" alt="ctdac_fast_init_funcusage.png"/>
</div>
 <div class="fragment"><div class="line">    <span class="comment">/* Scenario: Quickly configure the CTDAC and CTB blocks to work together.</span></div><div class="line"><span class="comment">     * The CTDAC uses the internal AREF bandgap reference buffered with Opamp1</span></div><div class="line"><span class="comment">     * and Opamp0 buffers the CTDAC output to P9.2. */</span></div><div class="line">    </div><div class="line">    <a class="code" href="group__group__ctdac__enums.html#ga7b2ca56166b65cd317310f9d42aa8714">cy_en_ctdac_status_t</a> ctdacStatus;</div><div class="line">    <a class="code" href="group__group__ctb__enums.html#ga63b4a5fd454ef30adc407445dc6d6a0d">cy_en_ctb_status_t</a> ctbStatus;</div><div class="line">    </div><div class="line">    <span class="comment">/* The AREF block must be initialized and enabled to provide a 1.2 V voltage reference</span></div><div class="line"><span class="comment">     * for the CTDAC and the current references for the opamps. */</span></div><div class="line">    (void) <a class="code" href="group__group__sysanalog__functions.html#gacef4e5ae550518abd0004e46e5ec4d64">Cy_SysAnalog_Init</a>(&amp;<a class="code" href="group__group__sysanalog__globals.html#ga85e9e1cd8c1e6fe581043cbab3083017">Cy_SysAnalog_Fast_Local</a>);</div><div class="line">    <a class="code" href="group__group__sysanalog__functions.html#ga153249c7b4cea72ee334ae877a211169">Cy_SysAnalog_Enable</a>();</div><div class="line">    </div><div class="line">    <span class="comment">/* Buffer the reference and output of the CTDAC. */</span></div><div class="line">    ctdacStatus = <a class="code" href="group__group__ctdac__functions__init.html#ga66f44760b2a923f78135b20060c5700d">Cy_CTDAC_FastInit</a>(CTDAC0, &amp;<a class="code" href="group__group__ctdac__globals.html#ga28e709a157ae32116c0eca332ef6fc65">Cy_CTDAC_Fast_OA1Ref_BufferedOut</a>);</div><div class="line">    </div><div class="line">    <span class="comment">/* Buffer the CTDAC output using Opamp0 to P9.2.</span></div><div class="line"><span class="comment">     * Buffer the internal AREF bandgap voltage for the CTDAC reference using Opamp1. */</span></div><div class="line">    ctbStatus = <a class="code" href="group__group__ctb__functions__init.html#ga7bdb789cecd993b6871bc3e31a239473">Cy_CTB_FastInit</a>(CTBM0, &amp;<a class="code" href="group__group__ctb__globals.html#gad9260078469c446c5f6b2e53b8925392">Cy_CTB_Fast_Opamp0_Vdac_Out</a>, &amp;<a class="code" href="group__group__ctb__globals.html#ga0ef4edc2f1f65ffd267518c2bb241bdd">Cy_CTB_Fast_Opamp1_Vdac_Ref_Aref</a>);</div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> ((<a class="code" href="group__group__ctb__enums.html#gga63b4a5fd454ef30adc407445dc6d6a0dad45a4f2cdf7cd6ceff1b792ee9fa22c4">CY_CTB_SUCCESS</a> == ctbStatus) &amp;&amp; (<a class="code" href="group__group__ctdac__enums.html#gga7b2ca56166b65cd317310f9d42aa8714a879677d631f02819c86007343cccaabe">CY_CTDAC_SUCCESS</a> == ctdacStatus))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Turn on the buffers before turning on the CTDAC. */</span></div><div class="line">        <a class="code" href="group__group__ctb__functions__init.html#ga867711bf1d5e8216b7bacdf0975fd712">Cy_CTB_Enable</a>(CTBM0);</div><div class="line">        <a class="code" href="group__group__ctdac__functions__init.html#gaf11183d5debb690a8240f2ee4d304d44">Cy_CTDAC_Enable</a>(CTDAC0);</div><div class="line">    }</div><div class="line">    </div></div><!-- fragment -->
</div>
</div>
<a id="gaf11183d5debb690a8240f2ee4d304d44"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf11183d5debb690a8240f2ee4d304d44">&#9670;&nbsp;</a></span>Cy_CTDAC_Enable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_CTDAC_Enable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Power up the CTDAC hardware block. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
<a id="ga5240b925d07516384e1e30cd3501161e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5240b925d07516384e1e30cd3501161e">&#9670;&nbsp;</a></span>Cy_CTDAC_Disable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_CTDAC_Disable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Turn off the hardware block. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
